﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ConceptsFramework.AbstractConceptElements;
using ConceptsFramework.DerivedRelationships;

namespace PatternExplorer.DerivedConcepts
{
    public class SingleGenericParameterSummary : AbstractBindableConcept, IEquatable<SingleGenericParameterSummary>
    {

        /// <summary>
        /// Defines the current argument type declared when the method is called
        /// </summary>
        public string GenericArgumentType
        {
            get; 
            set;
        }

        /// <summary>
        /// Defines the generic argument type declared in the generic class definition
        /// </summary>
        public string BaseGenericArgumentType
        {
            get;
            set;
        }

        public override bool IsRelationshipAutorized<T>()
        {
            Type paramType = typeof(T);
            if (typeof(IsContainedRelationship).IsAssignableFrom(paramType))
                return true;
            return false;
        }

        public override void ResolveInverseRelationships()
        {
            throw new NotImplementedException();
        }

        public bool Equals(SingleGenericParameterSummary other)
        {
            return (this.GenericArgumentType == other.GenericArgumentType);
        }
    }
}
